﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Utils;
namespace UI.ModEmployee
{
    public partial class EmpMonthMemberList : System.Web.UI.Page
    {
        string account = "";
        DefDicBiz defDicBiz = new DefDicBiz();
        EmployeeBiz employeeBiz = new EmployeeBiz();
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                User user = Session["user"] as User;
                account = user.Account;
            }
            else
            {
                JSUtility.Alert(this, "您没有登录!请先登录。");
                return;
            }
            if (!IsPostBack)
            {
                DateTime dt = System.DateTime.Now;
                defDicBiz.InitXMLDropDownList(ddlYear, "YearList.xml", "");
                defDicBiz.InitDropDownList(ddlYear, dt.Year.ToString());
                defDicBiz.InitXMLDropDownList(ddlMoth, "MonthList.xml", "");
                defDicBiz.InitDropDownList(ddlMoth, dt.Month.ToString());
            }
        }
        //该月人数
        protected void btnTotal_Click(object sender, EventArgs e)
        {
            ViewState["VsFlag"] = "total";
            int iYear = Int32.Parse(ddlYear.SelectedValue);
            int iMonth = Int32.Parse(ddlMoth.SelectedValue);
            BondDvTotal(iYear, iMonth);
          

        }
      
       
       
        protected void BondDvTotal(int iYear, int iMonth)
        {
            DataSet ds = employeeBiz.GetMonthNowNum(iYear, iMonth);
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    gvTotal.DataSource = ds.Tables[0];
                    gvTotal.DataBind();
                }
            }
        }

       
      

       
    }
}